package com.itcast.java.product.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itcast.java.product.entity.PmsCategoryEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 商品三级分类mapper类
 *
 * @author xiaobai
 * @date 2021-06-27 19:31:58
 */
@Repository
public interface PmsCategoryMapper extends BaseMapper<PmsCategoryEntity> {

    @Select("select * from pms_category where cat_id = #{id}")
    PmsCategoryEntity select(@Param("id") Long id);

    @Select("select name from pms_category where parent_cid = #{parentCid}")
    List<String> selectChildrenNameByParentCid(@Param("parentCid") Long parentCid);
}
